Skip to content

Conversation

@Dmitriy-Litvinenko
Copy link
Contributor

Purpose

#1330 Displayed individual requesters/proxies as anonymized. This applies the same logic to requesters/proxies that appear in the list.

Approach

This follows the same logic as displaying a single anonymized user vs deleted user based on whether the requestId is present.

Refs

https://folio-org.atlassian.net/browse/UIREQ-1314

Screenshots

image

Pre-Merge Checklist

Before merging this PR, please go through the following list and take appropriate actions.

  • I've added appropriate record to the CHANGELOG.md
  • Does this PR meet or exceed the expected quality standards?
    • Code coverage on new code is 80% or greater
    • Duplications on new code is 3% or less
    • There are no major code smells or security issues
  • Does this introduce breaking changes?
    • If any API-related changes - okapi interfaces and permissions are reviewed/changed correspondingly
    • There are no breaking changes in this PR.

If there are breaking changes, please STOP and consider the following:

  • What other modules will these changes impact?
  • Do JIRAs exist to update the impacted modules?
    • If not, please create them
    • Do they contain the appropriate level of detail? Which endpoints/schemas changed, etc.
    • Do they have all they appropriate links to blocked/related issues?
  • Are the JIRAs under active development?
    • If not, contact the project's PO and make sure they're aware of the urgency.
  • Do PRs exist for these changes?
    • If so, have they been approved?

Ideally all of the PRs involved in breaking changes would be merged in the same day to avoid breaking the folio-testing environment. Communication is paramount if that is to be achieved, especially as the number of intermodule and inter-team dependencies increase.

While it's helpful for reviewers to help identify potential problems, ensuring that it's safe to merge is ultimately the responsibility of the PR assignee.

Notes:

Origin pull request was #1334 but we was not able run Sonar for fork and we created current pull.

@github-actions
Copy link

github-actions bot commented Nov 7, 2025

Jest Unit Test Results

    1 files  ±0     66 suites  ±0   1m 46s ⏱️ -3s
  848 tests +3    848 ✅ +3  0 💤 ±0  0 ❌ ±0 
1 214 runs  +4  1 214 ✅ +4  0 💤 ±0  0 ❌ ±0 

Results for commit 740e56a. ± Comparison against base commit e7d9466.

♻️ This comment has been updated with latest results.

@Dmitriy-Litvinenko Dmitriy-Litvinenko requested a review from a team November 11, 2025 10:45
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
6.7% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud


## 13.0.0 IN PROGRESS

* Display Anonymized when searching requests. Refs UIREQ-1312.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to move it down to visualize that it was made last in this release (after * When creating or viewing a request, show whether the a loan on the item would be use-at-location. Fixes UIREQ-1327.).

},
};

function userFormatter(id, user) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Could you please move it to to src/utils.js for reuse in all places?
  2. As I understand it, we only need to show anonymized when the user id is null. Could you add a function to src/utils.js, for example:
export const isAnonymizedUser = (id) => {
  return id === null;
};

and use it in this function.
Just for example:

  if (user) {
    return getFullName(user);
  }

  if (isAnonymizedUser(id)) {
    return <FormattedMessage id="ui-requests.requestMeta.anonymized" />;
  }

  return <NoValue />;

With this approach it will be clearer what is happening. We correctly check that id === null and it will be clear why we are doing this.

},
};

function userFormatter(id, user) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please take a look on comment above for userFormatter?

'itemBarcode': rq => (rq?.item?.barcode || <NoValue />),
'position': rq => (rq.position || <NoValue />),
'proxy': rq => (rq.proxy ? getFullName(rq.proxy) : <NoValue />),
'proxy': rq => userFormatter(rq.proxyUserId, rq.proxy),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From https://folio-org.atlassian.net/browse/UXPROD-4302
And, if they exist, the proxy.lastName, proxy.firstName, proxy.barcode, and proxyUserId are removed from the request record
In story we do not have clear scenarios and difficult to understand correct behavior for current case.
How i understood if a requester has been anonymized then the requesterId and proxyUserId will be null.
Could you please double check do we need we show anonymized for proxy or NoValue?

'itemBarcode': rq => (rq?.item?.barcode || <NoValue />),
'position': rq => (rq.position || <NoValue />),
...(isProxyAvailable ? { 'proxy': rq => (rq.proxy ? getFullName(rq.proxy) : <NoValue />) } : {}),
...(isProxyAvailable ? { 'proxy': rq => userFormatter(rq.proxyUserId, rq.proxy) } : {}),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please take a look on comment above for 'proxy'?

@Dmitriy-Litvinenko
Copy link
Contributor Author

Hello. @brycekbargar Thank you for your pull request. We left several comment on them. Could you please take a look on them when you will have time?

@Dmitriy-Litvinenko
Copy link
Contributor Author

Hello. @folio-org/fe-tl-reviewers Could you please take a look when you will have time?

@Dmitriy-Litvinenko
Copy link
Contributor Author

Duplicate for #1348

@Dmitriy-Litvinenko Dmitriy-Litvinenko deleted the UIREQ-1314 branch January 14, 2026 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants